package com.action.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.controller.Action;
import com.dao.MemberDao;
import com.domain.Member;

public class AdminDeleteFormAction implements Action{
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		HttpSession session = request.getSession();
		String mem_id = (String)session.getAttribute("mem_id");
		
		if(mem_id == null){
			return "/view/member/loginForm.jsp";
		}
		
		String search_id = request.getParameter("search_id");
		MemberDao dao = MemberDao.getinstance();
		Member member = dao.getMember(search_id);
		
		request.setAttribute("member", member);
		request.setAttribute("search_id", search_id);
		
		return"/view/member/adminDeleteForm.jsp";
	}
}
